<template>
  <div>
    <h1>Test</h1>
    <router-link to="/">回首页</router-link>
  </div>
</template>

<script>
export default {
  name: 'Test',
  async mounted() {
    // this.$api.login({ userName: 'admin', userPwd: 'admin' }).then((res) => {
    //   console.log(res);
    // });
    const user = await this.$api.login({ userName: 'admin', userPwd: 'admin' });
    console.log(user);
    this.$store.commit('setUserInfo', user);
  },
};
</script>

<style lang="scss" scoped></style>
